import axios from 'axios';
import React, { useEffect, useState } from 'react'
import { httpGetLiveList } from '../apis';
import LiveItem from '../components/Live/LiveItem';

import "./Live.scss"

export default function Live() {
  let [liveList,setLiveList] = useState([]);
  // 首次渲染获取数据
  useEffect(async ()=>{
    // 获取数据
    let res = await httpGetLiveList();
    setLiveList(res);
  },[]);
  return (
    <div className='Live-container'>
      {
        liveList.map(v=>(
          <LiveItem {...v} key={v.liveId}></LiveItem>
        ))
      }
    </div>
  )
}
